package 多线程.乐观锁和悲观锁;

import java.util.concurrent.atomic.AtomicInteger;

public class 任务 implements   Runnable{
    public int 数字;
    public AtomicInteger 计数=new AtomicInteger();
    @Override
    public void run() {
        for (int i = 1; i <=100 ; i++) {
            System.out.println(计数.incrementAndGet());
        }
    }
}
